<template>
  <div class="statis-box">
    <div class="statis-header">{{ title }}</div>
    <div class="statis-main">
      <div v-for="entry in entrys" :key="entry.name" class="entry-item">
        <div class="entry-icon" :style="{ 'background-color': entry.color }">
          <i :class="entry.icon"></i>
        </div>
        <div class="entry-name">{{ entry.name }}</div>
      </div>
    </div>
  </div>
</template>

<script>
  import { defineComponent, toRefs, onMounted } from 'vue';
  import { useI18n } from '@common/locales';
  export default defineComponent({
    name: 'WorkFast',
    setup() {
      const t = useI18n().t;
      const state = {
        title: t('workBoard.fastEntry'),
        entrys: [
          { name: '请假申请', icon: 'fal fa-clipboard-list', color: '#f24f54' },
          { name: '加班申请', icon: 'fal fa-alarm-clock', color: '#00b5b5' },
          { name: '外出申请', icon: 'fal fa-user-circle', color: '#00a664' },
          { name: '出差申请', icon: 'fal fa-plane', color: '#fe774b' },
          { name: '借款申请', icon: 'fal fa-credit-card', color: '#fbc754' },
          { name: '用车申请', icon: 'fal fa-car-alt', color: '#7a6ff1' },
          { name: '酒店申请', icon: 'fal fa-university', color: '#fe774b' },
          { name: '招待申请', icon: 'fal fa-wine-glass-alt', color: '#f24f54' },
        ],
      };
      onMounted(() => {});
      return {
        ...toRefs(state),
      };
    },
  });
</script>
<style scoped lang="less">
  .statis-box {
    width: 615px;
    height: 370px;
    border-radius: 4px;
    background-color: #ffffff;
    .statis-header {
      width: 100%;
      height: 60px;
      line-height: 60px;
      padding: 0 20px;
      font-size: 16px;
      // font-family: 'PingFang SC, PingFang SC-Bold';
      font-weight: bold;
      color: #3f3f3f;
    }
    .statis-main {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
      padding: 0 30px;
      .entry-item {
        width: 58px;
        height: 88px;
        margin: 40px 40px 0;
        .entry-icon {
          width: 58px;
          height: 58px;
          text-align: center;
          border-radius: 50%;
          position: relative;
          box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
          i {
            color: #ffffff;
            font-size: 26px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
          }
        }
        .entry-name {
          width: 100%;
          height: 20px;
          line-height: 20px;
          text-align: center;
          font-size: 14px;
          // font-family: 'PingFang SC, PingFang SC-Normal';
          color: #3f3f3f;
          margin-top: 10px;
        }
      }
    }
  }
</style>
